package java.wxw;

import java.io.FileWriter;
import java.io.IOException;
import java.sql.SQLOutput;
import java.util.Scanner;

/**
 * @author wangxianwei weisuhang
 * @create 2020--06--19--15:34
 */
public class FileWrite1 extends Final{
    private int length=0;
    private String fileTest;

    public FileWrite1() {
    }

    public int fileWrite1() throws IOException {
        System.out.println("Please input text:");
        Scanner in =new Scanner(System.in);
        fileTest = in.next();
        char fileTestC[] = fileTest.toCharArray();
        //字符流的写入数据
        FileWriter writer = new FileWriter(file);
        writer.write(fileTestC);
        writer.close();
        return fileTest.length();
    }
}
